< previous page page_52 next page >

Page 52
(Continued)
Table 1.5 Constants for Using System-Defined Colors
CONSTANTVALUECOLOR FOR:
vbButtonShadow&H80000010Command button edge shading
vbGrayText&H80000011Disabled text
vbButtonText&H80000012Command button text
vblnactiveCaptionText&H80000013Inactive caption text
vb3DHighlight&H800000143D object highlight
vb3DDKShadow&H800000153D object darkest shadow
vb3DLight&H800000163D object lightest color after vb3DHighlight
vbInfoText&H80000017ToolTips text
vbInfoBackground&H80000018ToolTips background

Example program SysColor, shown in Figure 1.30, displays the system-defined colors currently set on your system.
Decomposing Colors
For a color stored in an RGB format, you can use the method described earlier to break the color into its red, green, and blue components. Some objects, however, use system color indexes instead of RGB colors. For example, a label control's BackColor property might have the value &H8000000F.
In cases like this, you can remove the leftmost digit from this number and use the result as the input to the GetSysColor API function. This function returns the true color associated with a system color index. You can now use the method described earlier to break the color into its components.
0052-01.jpg
Figure 1.30
Example program SysColor displays the system-defined colors.

 
< previous page page_52 next page >